<script setup lang="ts">
import type { HospitalInfoInterface } from '@/services/modules/home/type';
// import { useRouter } from 'vue-router';
interface Iprops {
  hospitalInfo: HospitalInfoInterface;
}
const props = defineProps<Iprops>();
// const $router = useRouter();
// const goToHospital = (hoscode: any) => {
//   // console.log(item.hoscode);
//   $router.push({ path: '/hospital/register', query: { hoscode } });
// };
</script>
<template>
  <div class="HospitalCard">
    <!-- 左: -->
    <div class="item-left">
      <!-- 标题 -->
      <div class="title">{{ props?.hospitalInfo?.hosname }}</div>
      <!--  简介: 二级甲等  每天22:00放号 -->
      <div class="intro">
        <div class="level">
          <svg
            t="1688268893064"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="897"
          >
            <path
              d="M891.392 870.4a40.96 40.96 0 1 1 0 81.92H117.76a40.96 40.96 0 1 1 0-81.92h773.632zM501.76 153.6a40.96 40.96 0 0 1 40.96 40.96v517.632a40.96 40.96 0 1 1-81.92 0V194.56a40.96 40.96 0 0 1 40.96-40.96zM215.04 51.2a40.96 40.96 0 0 1 40.96 40.96v620.032a40.96 40.96 0 1 1-81.92 0V92.16a40.96 40.96 0 0 1 40.96-40.96z m573.44 204.8a40.96 40.96 0 0 1 40.96 40.96v415.232a40.96 40.96 0 1 1-81.92 0V296.96a40.96 40.96 0 0 1 40.96-40.96z"
              fill="currentcolor"
              p-id="898"
            ></path>
          </svg>
          <span>{{ props.hospitalInfo?.param?.hostypeString }}</span>
        </div>
        <div class="time">
          <svg
            t="1688269108244"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="2003"
          >
            <path
              d="M512 1024C229.233778 1024 0 794.766222 0 512S229.233778 0 512 0s512 229.233778 512 512-229.233778 512-512 512z m0-967.111111C260.636444 56.888889 56.888889 260.636444 56.888889 512s203.747556 455.111111 455.111111 455.111111 455.111111-203.747556 455.111111-455.111111S763.363556 56.888889 512 56.888889z"
              fill="currentcolor"
              p-id="2004"
            ></path>
            <path
              d="M483.555556 540.444444h284.444444v56.888889H483.555556zM483.555556 256h56.888888v284.444444h-56.888888z"
              fill="currentcolor"
              p-id="2005"
            ></path>
          </svg>
          <span>每天{{ props.hospitalInfo?.bookingRule?.releaseTime }}放号</span>
        </div>
      </div>
    </div>

    <!-- 右:logo -->
    <div class="item-right">
      <img class="logo" :src="`data:image/jpeg;base64,${props.hospitalInfo.logoData}`" alt="" />
      <!-- <el-image fit="fill" class="logo" src="../../../../assets/images/logo.png" lazy /> -->
    </div>
  </div>
</template>
<style scoped lang="scss">
.HospitalCard {
  background-color: #fff;
  border: 1px solid #eee;
  cursor: pointer;
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  transition: all 0.3s ease;
  padding: 10px 20px;
  display: flex;

  &:hover {
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
  }

  .item-left {
    flex: 1;
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .title {
      color: #333;
      height: 42px;
      line-height: 42px;
      font-weight: 500;
      font-size: 16px;
      align-items: center;
      transition: all 0.2s ease;
      width: 100%;
    }
    .intro {
      flex: 1;
      color: #999;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .icon {
        width: 15px;
        height: 15px;
        color: #999999;
      }
      .level,
      .time {
        display: flex;
        justify-content: center;
        align-items: center;
        span {
          margin: 0 5px;
        }
      }
    }
  }
  .item-right {
    width: 80px;
    height: 80px;

    overflow: hidden;
    .logo {
      width: 100%;
      height: inherit;
      vertical-align: middle;
      border-radius: 50%;
    }
  }
}
</style>
